<script setup lang="ts">
// App.vue 是应用的根组件
import { useRouter } from 'vue-router'

const router = useRouter()
</script>

<template>
 t <div class="app-container">
    <div class="nav-header">
      <div class="logo">Loki Dashboard</div>
      <div class="nav-links">
        <el-button type="text" @click="router.push('/')">日志仪表板</el-button>
        <el-button type="text" @click="router.push('/demo')">组件演示</el-button>
      </div>
    </div>
    <div class="main-content">
      <router-view />
    </div>
  </div>
</template>

<style>
/* 全局样式 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

#app, .app-container {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  background-color: #409EFF;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-links .el-button--text {
  color: white;
  font-size: 16px;
}

.nav-links .el-button--text:hover {
  color: #f0f0f0;
}

.main-content {
  flex: 1;
  overflow: auto;
}

/* 一些通用的工具类 */
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.full-height {
  height: 100%;
}

.full-width {
  width: 100%;
}
</style>
